﻿@model Weibo.Web.Models.DetailsModel
                      @{
                          var border = "";
                          if (Model.OtherUser != null)
                          {
                              if (Model.OtherUserConfig.IsThemeDIY == 1)
                              {
                                  ThemeDIY diy = Themes.GetThemeDIYByUID(Model.OtherUser.ID);
                                  border = diy.BorderStyle + "Bg";
                              }
                          }
                          else
                          {
                              if (Model.CurUserConfig.IsThemeDIY == 1)
                              {
                                  ThemeDIY diy = Themes.GetThemeDIYByUID(Model.CurUser.ID);
                                  border = diy.BorderStyle + "Bg";
                              }
                          }
                          ViewData["curBorder"] = border;
 }
  @{
      Layout = "~/Views/Shared/_Layout.cshtml";
 }
 @{
     ViewBag.Title = (Model.OtherUser != null ? Model.OtherUser.NickName : Model.CurUser.NickName) + "的微博 XX微博-随时随地分享身边的新鲜事儿";
 }
 @section  cssInsert{
<link rel="stylesheet" type="text/css" href="/Content/CSS/miniblog/com_manage.css" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="@(string.IsNullOrEmpty(Model.OtherSkinCss) ? Model.CurSkinCss : Model.OtherSkinCss)" charset="utf-8"/>
}
 @section  jsInsert{
    <script type="text/javascript">
        var curBorder = "@border";
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            App.initMedia();
            App.initNameCard($(".MIB_mbloglist"));
            App.TimerFunArray.push(App.ajaxAtWho);
            App.StartTimer();
            App.bindGoTop(curBorder);
                    $.ajax(
       {
           async: false,
           url: "/Ajax/GetPagerCommentsHtml/",
           datatype: "json",
           cache: false,
           data: { Mid: @Model.MiniBlog.ID ,OwnerUid:@Model.MiniBlog.UID},
           type: "post",
           success: function (o) {
               if (o.Code == "A00003")
                   App.alert(CodeList[o.Code]);
               else if (o.Code == "A00011")
                   App.alert(CodeList[o.Code]);
               else {
                   $("#comment_list_"+"@Model.MiniBlog.ID").html(o.Data);
                   App.initNameCard($(".commentsList"));
                   $("#CommentCount").text(o.Count);
                   if(parseInt(o.Count)>20){
                     $(".commentsmanage").append("<div class=\"fanye MIB_txtbl MIB_linedot3\"></div>");
                     $(".navStyle").append("<div class=\"fanye MIB_txtbl\"></div>");
                     App.buildCommentPage(o,@Model.MiniBlog.ID,@Model.MiniBlog.UID,1,20,0);
                   }
                   var textbox=$("#comment_content_@{@Model.MiniBlog.ID}")[0];
				   App.bindTxtarea(textbox, { IsEnableAuto: true, keyUpCallBack: function () {
            if (App.getTxtLen(textbox) > 280) {
                textbox.value = App.GetStringByte(textbox.value, 280);
            }
        }
        });
             $('#comment_face_@{@Model.MiniBlog.ID}').click(function(e){
                 e.stopPropagation();
                 App.showExpression($(textbox),this);
                 return false;
             });
               }
           },
           error: function (request) {
               App.alert(CodeList["A00003"]);
           }
       }
    );
	
        });
        window.onload = function () {
    var voteItems = $("div[type='vote']");
    for (var i = 0; i < voteItems.length; i++) {
        var img = $(voteItems[i]).find("img")[0];
        var img1 = $(voteItems[i]).find("img")[1];

        $(img1).css("left", parseInt(($(img).width() - 33) / 2)).css("top", parseInt(($(img).height() - 33) / 2)).css("position", "absolute");
        $(img1).show();

    }
};
var follow = function (id, name, alink) {
            if (alink.locked)
                return;
            alink.locked = true;
           
            App.FollowOne(id, name, function (ID, Name, O) {
                if (O.Data == 1) {
                    $('<div class="MIB_btn_inter lf">互相关注<span class="MIB_line_sp">|</span><a onclick="cancelFollow(' + ID + ',\'' + Name + '\',this);return false;" href="javascript:void(0)" class="MIB_linkbl"><em>取消</em></a></div>').insertAfter($(alink).parent());
                    $(alink).parent().remove();
                }
                if (O.Data == 2) {
                    $('<div class="MIB_btn2 lf">已关注<span class="MIB_line_sp">|</span><a onclick="cancelFollow(' + ID + ',\'' + Name + '\',this);return false;" href="javascript:void(0)" class="MIB_linkbl"><em>取消</em></a></div>').insertAfter($(alink).parent());
                    $(alink).parent().remove();
                }
 
            }, function () { alink.locked = false; });
        };
        var cancelFollow = function (id, name, alink) {
            if (alink.locked)
                return;
            App.miniConfirm("是否取消关注" + name, alink, function () {
             
                alink.locked = true;
                App.CancelFollow(id, function (ID, O) {
                    if (O.Data == 3) {
                        $('<div class="lf"><a class="btn_add" onclick="follow(' + ID + ',\'' + name + '\',this);return false;" href="javascript:void(0)"><img src="/Content/Image/transparent.gif" alt="" title="已关注你" class="ico_addGrn"><em><img src="/Content/Image/transparent.gif" alt="" class="SG_icon add_icoz">&nbsp;加关注</em></a></div>').insertAfter($(alink).parent());
                        $(alink).parent().remove();
                    }
                    if (O.Data == 4) {
                        $('<div class="lf"><a onclick="follow(' + ID + ',\'' + name + '\',this);return false;" href="javascript:void(0);" class="btn_add"><img class="SG_icon" src="/Content/Image/transparent.gif" title="关注"><em>加关注</em></a></div>').insertAfter($(alink).parent());
                        $(alink).parent().remove();
                    }
  
                }, function () { alink.locked = false; });
            });

        };
    </script>
    }




<div class="MIB_blogbody">
<div class="MIB_mblogbgr @border">
<div class="MIB_mblogbgl">
<div class="mainR MIB_200 MIB_txtar MIB_linkar">
@{
    if (Model.OtherUser != null)
    {
    @RenderPage("~/Views/Shared/_otherInfo.cshtml")
    <div class="rTopAdd">
    @{
int relation = Users.GetRelateBetweenUsers(Model.CurUser.ID, Model.OtherUser.ID);
if (relation == 1)
{
                           <div class="MIB_btn_inter lf">互相关注<span class="MIB_line_sp">|</span><a onclick="cancelFollow(@Model.OtherUser.ID,'@Model.OtherUser.NickName',this);return false;" href="javascript:void(0)" class="MIB_linkbl"><em>取消</em></a></div>
}
if (relation == 2)
{
                               <div class="MIB_btn2 lf">已关注<span class="MIB_line_sp">|</span><a onclick="cancelFollow(@Model.OtherUser.ID,'@Model.OtherUser.NickName',this);return false;" href="javascript:void(0)" class="MIB_linkbl"><em>取消</em></a></div>
}
if (relation == 3)
{
                           <div class="lf"><a class="btn_add" onclick="follow(@Model.OtherUser.ID,'@Model.OtherUser.NickName',this);return false;" href="javascript:void(0)"><img src="/Content/Image/transparent.gif" alt="" title="已关注你" class="ico_addGrn"><em><img src="/Content/Image/transparent.gif" alt="" class="SG_icon add_icoz">&nbsp;加关注</em></a></div>
}
if (relation == 4)
{
                           <div class="lf"><a onclick="follow(@Model.OtherUser.ID,'@Model.OtherUser.NickName',this);return false;" href="javascript:void(0);" class="btn_add"><img class="SG_icon" src="/Content/Image/transparent.gif" title="关注"><em>加关注</em></a></div>
}        
    }
    </div>
                 @RenderPage("~/Views/Shared/Wedget_OtherInfo.cshtml")
                @RenderPage("~/Views/Shared/Wedget_OtherFan.cshtml")
               @RenderPage("~/Views/Shared/Wedget_OtherFollow.cshtml")
               @RenderPage("~/Views/Shared/Wedget_OtherTopic.cshtml")
                 @RenderPage("~/Views/Shared/Wedget_OtherTags.cshtml")
    }
    else
    {
          @RenderPage("~/Views/Shared/_userInfo.cshtml")
                 @RenderPage("~/Views/Shared/Wedget_MyInfo.cshtml")
                    @RenderPage("~/Views/Shared/Wedget_MyTags.cshtml")
                @RenderPage("~/Views/Shared/Wedget_MyFan.cshtml")
                @RenderPage("~/Views/Shared/Wedget_MyFollow.cshtml")
                
                @RenderPage("~/Views/Shared/Wedget_MyTopic.cshtml")
    }
}
</div>
<div class="mainL MIB_600 MIB_txtal MIB_linkal">
<div class="MIB_mbloglist">
 @{
     MiniBlog m = Model.MiniBlog;
     var dateSpan = DateSpan.Get(m.CreateTime);
     From from = Froms.GetFromByID(m.FromID);
     var user = Users.GetUserByID(m.UID);
     var content = MiniBlogs.BBCodeToHtml(m.RealContent);
     string[] media = m.MediaContent.Split(',');
     if (user != null)
     {
<div id="mid_@{@m.ID;}" class="singleBlogCont">
<p  mid="@{@m.ID;}" class="sms txtCont font_14"><a style="display:none;">@{@user.NickName;}：</a>@{@MvcHtmlString.Create(content);}
                                                </p>
                                                @{
                                                                                                                                if (m.IsOriginal == 1 && m.OriginalMID < 0)
                                                                                                                                {
                                                    <div id="prev_@{@m.ID;}" class="feed_preview" style="">
                                                        @{
                                                                         if (media[0] != "-1")
                                                                         {

                                                            <div class="feed_img">
                                                                <a href="javascript:;" onclick="App.scaleImg(this,'@{@m.ID;}');return false;">
                                                                    <img  class="imgicon" src="@{@media[4];}" /></a>
                                                                <img src="/Content/Image/loading.gif" style="position: absolute; background-color: transparent;
                                                                    border: 0px none; width: 16px; height: 16px; z-index: 1001; display: none;" />
                                                            </div>
                                                                         }
                                                                         if (media[1] != "-1")
                                                                         {
    
                                                            <div class="feed_img" type="video" vid="@{@media[1];}" mid="@{@m.ID;}" style="width: 120px; height: 90px;">
                                                                <a onclick="return false;" href="javascript:void(0);">
                                                                    <img width="120" height="90" style="cursor: pointer;" class="imgicon"
                                                                    src="@{@media[5];}" /></a><img src="/Content/Image/feedvideoplay.gif" onmouseover="App.mouseoverIco(this);" onmouseout="App.mouseoutIco(this);" style="cursor: pointer;
                                                                        display: block; margin-top: -61.5px; margin-left: 43.5px; opacity: 0.5; filter: alpha(opacity=50);" /></div>
                                                             
                                                                         }
                                                                         if (media[2] != "-1")
                                                                         {
                                                            <div class="feed_img" type="music" musicid="@{@media[2];}" mid="@{@m.ID;}" style="width: 135px; height: 33px;">
                                                                <a onclick="return false;" href="javascript:void(0);">
                                                                    <img style="cursor: pointer;" class="imgicon" src="/Content/Image/music_s.gif" /></a></div>
                                                                         }
                                                                         if (media[3] != "-1")
                                                                         {
                                                                             if (!string.IsNullOrEmpty(media[6]))
                                                                             {
                                                            <div class="feed_img" type="vote" voteid="@{@media[3];}" mid="@{@m.ID;}" >
                                                                <a onclick="return false;" href="javascript:void(0);">
                                                                    <img style="cursor: pointer;" class="imgicon" src="@{@media[6];}" /></a><img  onmouseover="App.mouseoverIco(this);" onmouseout="App.mouseoutIco(this);" src="/Content/Image/vote_picicon_01.gif"
                                                                        style="cursor: pointer; display: none;
                                                                        opacity: 0.5; filter: alpha(opacity=50);"></div>
                                                        
                                                                             }
                                                                             else
                                                                             {
                                                            <div class="feed_img" type="vote" voteid="@{@media[3];}" mid="@{@m.ID;}" style="width: 120px; height: 90px;">
                                                                <a onclick="return false;" href="javascript:void(0);">
                                                                    <img style="cursor: pointer;" class="imgicon" src="/Content/Image/vote_pic_01.gif" /></a></div>
                                                                             }
                                                                         }
                                                        }
                                                        <div class="clear">
                                                        </div>
                                                    </div>
                                                    <div style="display: none;" id="disp_@{@m.ID;}" class="MIB_assign">
                                                    </div>
                                                                                                                                }
                                                                                                                                else
                                                                                                                                {
                                                                                                                                    MiniBlog oriMBlog = MiniBlogs.GetMiniBlogByID(m.OriginalMID);
                                                                                                                                    if (oriMBlog != null)
                                                                                                                                    {
                                                                                                                                        var odateSpan = DateSpan.Get(oriMBlog.CreateTime);
                                                                                                                                        From ofrom = Froms.GetFromByID(oriMBlog.FromID);

                                                                                                                                        var ocontent = MiniBlogs.BBCodeToHtml(oriMBlog.RealContent);
                                                                                                                                        string[] omedia = oriMBlog.MediaContent.Split(',');
                                                                                                                                        User oriUser = Users.GetUserByID(oriMBlog.UID);
                                                                                                                                        if (oriUser != null)
                                                                                                                                        {
                                                                                                     
                                                    <div class="MIB_assign">
                                                        <div class="MIB_asarrow_l">
                                                        </div>
                                                        <div class="MIB_assign_t">
                                                        </div>
                                                        <div class="MIB_assign_c MIB_txtbl">
                                                            <p  mid="@{@m.ID;}" class="source"><a href="/@{@oriUser.ID;}" uid="@{@oriUser.ID;}" namecard="true" uname="@{@oriUser.NickName;}" >@@@{@oriUser.NickName;}</a>：@{@MvcHtmlString.Create(ocontent);}</p>
                                                            <div id="prev_@{@m.ID;}" class="feed_preview" mbind="1" style="">
                                                                @{
                                                                                 if (omedia[0] != "-1")
                                                                                 {

                                                                    <div class="feed_img">
                                                                        <a href="javascript:;" onclick="App.scaleImg(this,'@{@m.ID;}');return false;">
                                                                            <img vimg="1" class="imgicon" src="@{@omedia[4];}" /></a>
                                                                        <img src="/Content/Image/loading.gif" style="position: absolute; background-color: transparent;
                                                                            border: 0px none; width: 16px; height: 16px; z-index: 1001; display: none;" />
                                                                    </div>
                                                                                 }
                                                                                 if (omedia[1] != "-1")
                                                                                 {
                                                                    <div class="feed_img" type="video" vid="@{@omedia[1];}" mid="@{@m.ID;}" style="width: 120px; height: 90px;">
                                                                        <a onclick="return false;" href="#">
                                                                            <img width="120" height="90" style="cursor: pointer;" class="imgicon"
                                                                    src="@{@omedia[5];}" /></a><img src="/Content/Image/feedvideoplay.gif" onmouseover="App.mouseoverIco(this);" onmouseout="App.mouseoutIco(this);"  style="cursor: pointer;
                                                                        display: block; margin-top: -61.5px; margin-left: 43.5px; opacity: 0.5; filter: alpha(opacity=50);" /></div>
                                                                                 }
                                                                                 if (omedia[2] != "-1")
                                                                                 {
                                                                    <div class="feed_img" type="music" musicid="@{@omedia[2];}" mid="@{@m.ID;}" style="width: 135px; height: 33px;">
                                                                        <a onclick="return false;" href="#">
                                                                            <img style="cursor: pointer;" class="imgicon" src="/Content/Image/music_s.gif" /></a></div>
                                                                                 }
                                                                                 if (omedia[3] != "-1")
                                                                                 {
                                                                                     if (!string.IsNullOrEmpty(omedia[6]))
                                                                                     {
                                                                    <div class="feed_img" type="vote" voteid="@{@omedia[3];}" mid="@{@m.ID;}"  >
                                                                        <a onclick="return false;" href="#">
                                                                            <img style="cursor: pointer;" class="imgicon" src="@{@omedia[6];}" /></a><img onmouseover="App.mouseoverIco(this);" onmouseout="App.mouseoutIco(this);"  src="/Content/Image/vote_picicon_01.gif"
                                                                                style="cursor: pointer; display: none; 
                                                                                opacity: 0.5; filter: alpha(opacity=50);"></div>
                                                                                     }
                                                                                     else
                                                                                     {
                                                        
                                                                    <div class="feed_img" type="vote" voteid="@{@omedia[3];}" mid="@{@m.ID;}"  style="width: 120px; height: 90px;">
                                                                        <a onclick="return false;" href="#">
                                                                            <img style="cursor: pointer;" class="imgicon" src="/Content/Image/vote_pic_01.gif" /></a></div>
                                                                                     }
                                                                                 }
                                                                }
                                                                <div class="clear">
                                                                </div>
                                                            </div>
                                                            <div style=" display: none;" id="disp_@{@m.ID;}" class="blogPicOri">
                                                            </div>
                                                            <div class="feed_att MIB_linkbl MIB_txtbl">
                                                                <div class="lf">
                                                                    <cite><a  href="/@{@oriUser.ID;}/@{@oriMBlog.IDCode;}"><strong>
                                                                        @{@odateSpan;}
                                                                    </strong></a></cite><strong>来自</strong><cite><a
                                                                            target="_blank" href="@{@ofrom.FromUrl;}">@{@ofrom.FromName;}
                                                                    </a></cite>
                                                                </div>
                                                                <div class="rt">
                                                                    <a  href="/@{@oriUser.ID;}/@{@oriMBlog.IDCode;}">转发@{
                                                                                                                 if (oriMBlog.QuoteCount > 0)
                                                                                                                 {<strong type="rttCount">(@{@oriMBlog.QuoteCount;})</strong>
                                                                                                                 }
                                                                        }
                                                                    </a><span class="MIB_line_l">|</span> <a  href="/@{@oriUser.ID;}/@{@oriMBlog.IDCode;}">
                                                                        评论@{
                                                                                                                                                       if (oriMBlog.CommentCount > 0)
                                                                                                                                                       {<strong type="commtCount" >(@{@oriMBlog.CommentCount;})</strong>
                                                                                                                                                       }
                                                                        }
                                                                    </a>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="MIB_assign_b">
                                                        </div>
                                                    </div>
                                                                                                                                        }
                                                                                                                                    }
                                                                                                                                    else
                                                                                                                                    {
                                                    <div class="MIB_assign">
                                                        <div class="MIB_asarrow_l">
                                                        </div>
                                                        <div class="MIB_assign_t">
                                                        </div>
                                                        <div class="MIB_assign_c MIB_txtbl">
                                                            <p class="source">
                                                                该微博已被删除</p>
                                                        </div>
                                                        <div class="MIB_assign_b">
                                                        </div>
                                                    </div>
                                                                                                                                    }
                                                                                                                                }
                                                }
                                                <!-- 转发 -->
                                                <!-- 转发 -->
                                                <div class="comeform MIB_linkbl">
                                                    <div class="lf MIB_txtbl">
                                                        <strong>
                                                            @{@dateSpan;}
                                                        </strong><strong>来自</strong><cite><a
                                                                 target="_blank" href="@{@from.FromUrl;}">@{@from.FromName;}
                                                        </a></cite>
                                                        @{
                                                                                                                          if (m.UID != Model.CurUser.ID)
                                                                                                                          {
                                                        <span class="MIB_line_l">|</span><cite><a onclick="App.showReportBox(this,@user.ID,@TypeConfigs.GetComplaint_mb,@m.ID);return false;" href="javascript:void(o);">举报</a></cite>
                 
                                                                                                                          }
                 }
                                                            </div>
                                                    <div class="rt">
                                                        <!-- 转发 -->
                                                        @{
                                                                                                                          if (user.ID == Model.CurUser.ID)
                                                                                                                          {
                                                            <strong><a onclick="App.miniblogDel('@{@m.ID;}',this)" href="javascript:void(0);"><strong>
                                                                删除</strong></a><span class="MIB_line_l">|</span></strong>
                                                                                                                          }
                                                        }
                                                        <a onclick="App.showFeedDiv('@{@m.ID;}',@{@m.IsOriginal;},'@{@m.OriginalMID;}');return false;"
                                                            href="javascript:void(0);"><strong lang="CD0023">转发</strong>@{
                                                                                                                                   if (m.QuoteCount > 0)
                                                                                                                                   {<strong type="rttCount"id="num_@{@m.ID;}">(@{@m.QuoteCount;})</strong>
                                                                                                                                   }
                                                            }
                                                        </a>
                                                        <!-- 转发 -->
                                                        <span class="MIB_line_l">|</span> <a onclick="App.AddFavorite(@{@Model.CurUser.ID},@{@m.ID;},this);return false;"
                                                            href="javascript:void(0);"><strong lang="CL1003">收藏</strong></a>
                                                        <!-- 评论 -->
                                                        <span class="MIB_line_l">|</span> <a
                                                            href="javascript:void(0);" id="comment_count_@{@m.ID;}"><strong>评论</strong>@{
                                                                                                                if (m.CommentCount > 0)
                                                                                                                {<strong>(@{@m.CommentCount;})</strong>
                                                                                                                }
                                                            }
                                                        </a>
                                                        <!-- 评论 -->
                                                    </div>
                                                </div>
                                                <div id="comment_list_@{@m.ID;}">
                                                <div style="padding:30px 0;text-align:center"><img src="/Content/Image/loading.gif"></div>
                                                </div>
                                            </div>
     }
             }

</div>
</div>
</div>
</div>
</div>

